package io.github.rascaler.dcenter.platforms.binance;
import io.github.rascaler.dcenter.constant.ConstantItem;
import io.github.rascaler.dcenter.constant.ExceptionCode;
import io.github.rascaler.dcenter.exception.BizException;

/**
 * @ClassName BinanceFrequency
 * @Description TODO
 * @Author wurenqing
 * @Date 2023-12-08 11:11
 */
public class BinanceFrequency {
    public static String getFrequency(String standardFrequency) {
        switch (standardFrequency) {
            case ConstantItem.FREQUENCY_1S:
                return "1s";
            case ConstantItem.FREQUENCY_1MIN:
                return "1m";
            case ConstantItem.FREQUENCY_3MIN:
                return "3m";
            case ConstantItem.FREQUENCY_5MIN:
                return "5m";
            case ConstantItem.FREQUENCY_15MIN:
                return "15m";
            case ConstantItem.FREQUENCY_30MIN:
                return "30m";
            case ConstantItem.FREQUENCY_1HOUR:
                return "1h";
            case ConstantItem.FREQUENCY_2HOUR:
                return "2h";
            case ConstantItem.FREQUENCY_4HOUR:
                return "4h";
            case ConstantItem.FREQUENCY_6HOUR:
                return "6h";
            case ConstantItem.FREQUENCY_8HOUR:
                return "8h";
            case ConstantItem.FREQUENCY_12HOUR:
                return "12h";
            case ConstantItem.FREQUENCY_1D:
                return "1d";
            default:
                throw new BizException(ExceptionCode.ILLEGAL_FREQUENCY);
        }
    }

}
